## API Report File for "@backstage/backend-dynamic-feature-service"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { BackstagePackageJson } from '@backstage/cli-node';
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
import { Config } from '@backstage/config';
import { ConfigSchema } from '@backstage/config-loader';
import { EventBroker } from '@backstage/plugin-events-node';
import { EventsBackend } from '@backstage/plugin-events-backend';
import { FeatureDiscoveryService } from '@backstage/backend-plugin-api/alpha';
import { HttpPostIngressOptions } from '@backstage/plugin-events-node';
import { IdentityApi } from '@backstage/plugin-auth-node';
import { IndexBuilder } from '@backstage/plugin-search-backend-node';
import { Logger } from 'winston';
import { LoggerService } from '@backstage/backend-plugin-api';
import { PackagePlatform } from '@backstage/cli-node';
import { PackageRole } from '@backstage/cli-node';
import { PermissionEvaluator } from '@backstage/plugin-permission-common';
import { PermissionPolicy } from '@backstage/plugin-permission-node';
import { PluginCacheManager } from '@backstage/backend-common';
import { PluginDatabaseManager } from '@backstage/backend-common';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { RootLoggerService } from '@backstage/backend-plugin-api';
import { Router } from 'express';
import { ServiceFactory } from '@backstage/backend-plugin-api';
import { ServiceRef } from '@backstage/backend-plugin-api';
import { TaskRunner } from '@backstage/backend-tasks';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
import { TokenManager } from '@backstage/backend-common';
import { UrlReader } from '@backstage/backend-common';

// @public (undocumented)
export interface BackendDynamicPlugin extends BaseDynamicPlugin {
  // (undocumented)
  installer: BackendDynamicPluginInstaller;
  // (undocumented)
  platform: 'node';
}

// @public (undocumented)
export type BackendDynamicPluginInstaller =
  | LegacyBackendPluginInstaller
  | NewBackendPluginInstaller;

// @public (undocumented)
export interface BackendPluginProvider {
  // (undocumented)
  backendPlugins(): BackendDynamicPlugin[];
}

// @public (undocumented)
export interface BaseDynamicPlugin {
  // (undocumented)
  name: string;
  // (undocumented)
  platform: PackagePlatform;
  // (undocumented)
  role: PackageRole;
  // (undocumented)
  version: string;
}

// @public (undocumented)
export type DynamicPlugin = FrontendDynamicPlugin | BackendDynamicPlugin;

// @public (undocumented)
export class DynamicPluginManager implements DynamicPluginProvider {
  // (undocumented)
  addBackendPlugin(plugin: BackendDynamicPlugin): void;
  // (undocumented)
  get availablePackages(): ScannedPluginPackage[];
  // (undocumented)
  backendPlugins(): BackendDynamicPlugin[];
  // (undocumented)
  static create(
    options: DynamicPluginManagerOptions,
  ): Promise<DynamicPluginManager>;
  // (undocumented)
  frontendPlugins(): FrontendDynamicPlugin[];
  // (undocumented)
  plugins(): DynamicPlugin[];
}

// @public (undocumented)
export interface DynamicPluginManagerOptions {
  // (undocumented)
  config: Config;
  // (undocumented)
  logger: LoggerService;
  // (undocumented)
  moduleLoader?: ModuleLoader;
  // (undocumented)
  preferAlpha?: boolean;
}

// @public (undocumented)
export interface DynamicPluginProvider
  extends FrontendPluginProvider,
    BackendPluginProvider {
  // (undocumented)
  plugins(): DynamicPlugin[];
}

// @public (undocumented)
export interface DynamicPluginsFactoryOptions {
  // (undocumented)
  moduleLoader?(logger: LoggerService): ModuleLoader;
}

// @public (undocumented)
export const dynamicPluginsFeatureDiscoveryServiceFactory: () => ServiceFactory<
  FeatureDiscoveryService,
  'root'
>;

// @public (undocumented)
export const dynamicPluginsFrontendSchemas: () => BackendFeature;

// @public (undocumented)
export const dynamicPluginsRootLoggerServiceFactory: () => ServiceFactory<
  RootLoggerService,
  'root'
>;

// @public (undocumented)
export interface DynamicPluginsSchemasOptions {
  schemaLocator?: (pluginPackage: ScannedPluginPackage) => string;
}

// @public (undocumented)
export interface DynamicPluginsSchemasService {
  // (undocumented)
  addDynamicPluginsSchemas(configSchema: ConfigSchema): Promise<{
    schema: ConfigSchema;
  }>;
}

// @public (undocumented)
export const dynamicPluginsSchemasServiceFactory: (
  options?: DynamicPluginsSchemasOptions | undefined,
) => ServiceFactory<DynamicPluginsSchemasService, 'root'>;

// @public (undocumented)
export const dynamicPluginsServiceFactory: (
  options?: DynamicPluginsFactoryOptions | undefined,
) => ServiceFactory<DynamicPluginProvider, 'root'>;

// @public (undocumented)
export const dynamicPluginsServiceRef: ServiceRef<
  DynamicPluginProvider,
  'root'
>;

// @public (undocumented)
export interface FrontendDynamicPlugin extends BaseDynamicPlugin {
  // (undocumented)
  platform: 'web';
}

// @public (undocumented)
export interface FrontendPluginProvider {
  // (undocumented)
  frontendPlugins(): FrontendDynamicPlugin[];
}

// @public (undocumented)
export function isBackendDynamicPluginInstaller(
  obj: any,
): obj is BackendDynamicPluginInstaller;

// @public @deprecated (undocumented)
export interface LegacyBackendPluginInstaller {
  // (undocumented)
  catalog?(builder: CatalogBuilder, env: LegacyPluginEnvironment): void;
  // (undocumented)
  events?(
    eventsBackend: EventsBackend,
    env: LegacyPluginEnvironment,
  ): HttpPostIngressOptions[];
  // (undocumented)
  kind: 'legacy';
  // (undocumented)
  permissions?: {
    policy?: PermissionPolicy;
  };
  // (undocumented)
  router?: {
    pluginID: string;
    createPlugin(env: LegacyPluginEnvironment): Promise<Router>;
  };
  // (undocumented)
  scaffolder?(env: LegacyPluginEnvironment): TemplateAction<any>[];
  // (undocumented)
  search?(
    indexBuilder: IndexBuilder,
    schedule: TaskRunner,
    env: LegacyPluginEnvironment,
  ): void;
}

// @public @deprecated (undocumented)
export type LegacyPluginEnvironment = {
  logger: Logger;
  cache: PluginCacheManager;
  database: PluginDatabaseManager;
  config: Config;
  reader: UrlReader;
  discovery: PluginEndpointDiscovery;
  tokenManager: TokenManager;
  permissions: PermissionEvaluator;
  scheduler: PluginTaskScheduler;
  identity: IdentityApi;
  eventBroker: EventBroker;
  pluginProvider: BackendPluginProvider;
};

// @public (undocumented)
export interface ModuleLoader {
  // (undocumented)
  bootstrap(backstageRoot: string, dynamicPluginPaths: string[]): Promise<void>;
  // (undocumented)
  load(id: string): Promise<any>;
}

// @public (undocumented)
export interface NewBackendPluginInstaller {
  // (undocumented)
  install(): BackendFeature | BackendFeature[];
  // (undocumented)
  kind: 'new';
}

// @public (undocumented)
export type ScannedPluginManifest = BackstagePackageJson &
  Required<Pick<BackstagePackageJson, 'main'>> &
  Required<Pick<BackstagePackageJson, 'backstage'>> & {
    backstage: Required<BackstagePackageJson['backstage']>;
  };

// @public (undocumented)
export interface ScannedPluginPackage {
  // (undocumented)
  location: URL;
  // (undocumented)
  manifest: ScannedPluginManifest;
}

// (No @packageDocumentation comment for this package)
```
